﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace dotNetInteropPlugin.PluginDev
{
    //public interface IAIMPManagedPlugin: IDisposable
    //{
    //    bool HasSettingDialog
    //    {
    //        get;
    //    }

    //    void ShowSettingDialog(System.Windows.Forms.IWin32Window ParentWnd);
    //    //void Dispose();
    //    void Initialize(IMAIMPPlayer player);
    //}



    public abstract class MAIMPManagedPluginFirstLevel: MarshalByRefObject//, IDisposable
    {
        /// <summary>
        /// If true, then plugin has setting dialog
        /// </summary>
        public abstract bool HasSettingDialog
        {
            get;
        }

        /// <summary>
        /// Show settings dialog
        /// </summary>
        /// <param name="ParentWnd">Parent window</param>
        public abstract void ShowSettingDialog(System.Windows.Forms.IWin32Window ParentWnd);
        /// <summary>
        /// Inside this function, plugin should perform all initialization
        /// </summary>
        public abstract void Initialize();
        /// <summary>
        /// Inside this function, plugin should dispose all resources
        /// </summary>
        public abstract void Dispose();

        internal void OnDispose()
        {
            Dispose();
            inPlayer.Dispose();
            inPlayer = null;
        }
        internal void OnInitialize(IMAIMPPlayerFirstLevel player, int UnID)
        {
            _UniqueID = UnID;
            inPlayer = player;
            Initialize();
        }

        internal int _UniqueID
        {
            get;
            set;
        }

        internal IMAIMPPlayerFirstLevel inPlayer;

        internal IMAIMPPlayerFirstLevel PlayerFLvl
        {
            get {return inPlayer;}
        }

        //public IMAIMPPlayer Player
        //{
        //    get;
        //    private set;
        //}
    }
}
